﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Site.Master" AutoEventWireup="true" CodeBehind="detailproject.aspx.cs" Inherits="聚欣订单分析.OrderAna.detailproject" %>

<%@ Register Assembly="DevExpress.Web.v18.1, Version=18.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function btnAdd() {
            var btnID = "<%=btnAdd.ClientID%>";
            document.getElementById(btnID).click();
        }


        function btnDel() {
            if (confirm("确认删除跟踪信息，确认要删除？")) {
                var btnID = "<%=btnDel.ClientID%>";
                document.getElementById(btnID).click();
            }
        }
        function btnPz() {
            var txtID = "<%=txtPzs.ClientID%>";
            var c = document.getElementById(txtID).value;
            if (c == "") {
                alert("请填写内容！");
                document.getElementById(txtID).focus();
            }
            else {
                var btnID = "<%=btnPz.ClientID%>";
                document.getElementById(btnID).click();
            }
        }
        function btnSel() {
            var txtID = "<%=txtPzs.ClientID%>";
            var btnID = "<%=btnSel.ClientID%>";
            document.getElementById(btnID).click();
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_NAV" runat="server">
    <span style="font-size: x-small"><%=Request.QueryString["mname"].ToString() %></span>
    <span>跟踪情况</span>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_Contents" runat="server">
    <div style="display: none;">
        <asp:Button ID="btnAdd" runat="server" Text="新增服务端" OnClick="btnAdd_Click" />
        <asp:Button ID="btnDel" runat="server" Text="删除服务端" OnClick="btnDel_Click" />
        <asp:Button ID="btnPz" runat="server" Text="删除服务端" OnClick="btnPz_Click" />
        <asp:Button ID="btnSel" runat="server" Text="搜索服务端" OnClick="btnSel_Click" />
    </div>
    <div class="content-page">
        <div class="content">
            <div class="am-g">
                <!-- Row start -->
                <div class="card-box">
                    <div class="am-g" style="padding-bottom: 10px">
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button id="btnNew" type="button" class="am-btn am-btn-default" onclick="btnAdd()"><span class="am-icon-plus"></span>新增</button>
                                    <button type="button" class="am-btn am-btn-default" onclick="btnDel()"><span class="am-icon-trash-o"></span>删除</button>
                                    <button type="button" class="am-btn am-btn-default" onclick="btnPz()"><span class="am-icon-archive"></span>批注</button>
                                </div>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" id="txtPzs" runat="server" class="am-form-field">
                                <span class="am-input-group-btn">
                                    <button class="am-btn am-btn-default" onclick="btnSel()" type="button">搜索</button>
                                </span>
                            </div>
                        </div>
                    </div>
                    <!--.am-form input[type="text"],-->

                    <dx:ASPxGridView ID="ASPxGridView1" runat="server" Width="100%" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ID" OnRowValidating="ASPxGridView1_RowValidating" OnRowInserted="ASPxGridView1_RowInserted" OnRowUpdated="ASPxGridView1_RowUpdated">
                        <Columns>
                            <dx:GridViewCommandColumn Caption="选择" ShowSelectCheckbox="True" VisibleIndex="0" Width="40px">
                            </dx:GridViewCommandColumn>
                            <dx:GridViewDataTextColumn FieldName="ID" ReadOnly="True" VisibleIndex="0" Visible="false">
                                <EditFormSettings Visible="False" />
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn FieldName="projectid" VisibleIndex="1" Visible="false">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataMemoColumn Caption="跟踪情况" FieldName="situation" VisibleIndex="2">
                                <EditFormSettings Visible="True" />
                                <PropertiesMemoEdit Rows="6">
                                </PropertiesMemoEdit>
                                <EditFormSettings ColumnSpan="2" />
                            </dx:GridViewDataMemoColumn>
                            <dx:GridViewDataTextColumn Caption="跟踪人" FieldName="situationuser" VisibleIndex="2">
                                <EditFormSettings Visible="False" />
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn Caption="跟踪时间" FieldName="situationtime" VisibleIndex="3">
                                <EditFormSettings Visible="False" />
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataMemoColumn Caption="批注" FieldName="comment" VisibleIndex="4">
                                <EditFormSettings Visible="False" />
                                <PropertiesMemoEdit Rows="6">
                                </PropertiesMemoEdit>
                                <EditFormSettings ColumnSpan="2" />
                            </dx:GridViewDataMemoColumn>
                            <dx:GridViewDataTextColumn Caption="批注人" FieldName="commentuser" VisibleIndex="4">
                                <EditFormSettings Visible="False" />
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn Caption="批注时间" FieldName="commenttime" VisibleIndex="5">
                                <EditFormSettings Visible="False" />
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewCommandColumn Caption="编辑" VisibleIndex="13" Width="60px" ShowEditButton="true" ShowCancelButton="true" ShowUpdateButton="true">
                            
                            </dx:GridViewCommandColumn>
                        </Columns>
                        <Templates>
                            <PreviewRow>
                                <table style="border: none">
                                    <tr>
                                        <td>跟踪情况：<%# Eval("situation") %>(<%# Eval("situationuser") %>)</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <%# bpz(Eval("comment"),Eval("commentuser")) %>
                                        </td>
                                    </tr>
                                </table>
                            </PreviewRow>
                        </Templates>
                        <SettingsPager PageSize="20" AlwaysShowPager="True">
                        </SettingsPager>
                    </dx:ASPxGridView>
                </div>
            </div>
            <!-- Row end -->
        </div>
    </div>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:JXDDConnectionString %>" SelectCommand="SELECT * FROM [detailstable] WHERE ([projectid] = @projectid) ORDER BY [situationtime] DESC" UpdateCommand="update detailstable set situation=@situation,situationtime=getdate(),situationuser=@situationuser where ID=@ID" InsertCommand="insert into detailstable(projectid,situation,situationuser,situationtime)values(@projectid,@situation,@situationuser,getdate())">
        <SelectParameters>
            <asp:QueryStringParameter Name="projectid" QueryStringField="id" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:QueryStringParameter Name="projectid" QueryStringField="id" Type="Int32" />
            <asp:Parameter Name="situation" />
            <asp:SessionParameter Name="situationuser" SessionField="UserName" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ID" />
            <asp:Parameter Name="situation" />
            <asp:SessionParameter Name="situationuser" SessionField="UserName" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>
